home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / ANSI.SWG / 0015_Ansi Screens.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  2KB  |  67 lines

  1. {
  2. JAMES FIELDEN
  3.  
  4. > Ok, but how would you get the actual ANSI screens into one file,
  5. > (TheDraw for example makes them individually), and then know
  6. > their starting and ending positions?
  7. Here's part of a routine I used back in 1988 When I was a WWIV Junky When it
  8. was in Turbo Pascal.  I used this to combine all my ansi screens into
  9. one file and just pick the one out I needed.
  10. }
  11.  
  12. uses
  13.   Dos,
  14.   Crt;
  15. Var
  16.   infil  : Text;
  17.   nilfil : Text;
  18.   Star   : String;
  19.   Enn    : String;
  20.   Cup    : String[5];
  21.  
  22. Procedure PrintScr(Tfil, Loca, ELoca : String);
  23. Begin
  24.   assign(infil,Tfil);
  25.   {$I-}
  26.   reset(infil);
  27.   {$I+}
  28.   if IOResult <> 0 then
  29.   begin
  30.     Writeln(Tfil, ' Not Found');
  31.     Exit;
  32.   end;
  33.   assign(nilfil,'');
  34.   rewrite(nilfil);
  35.   repeat
  36.     readln(infil, Star);
  37.     Cup := Copy(Star,1,5);
  38.   until (Cup = Loca) or EOF(infil);
  39.   repeat
  40.     readln(infil, Enn);
  41.     Cup := Copy(Enn, 1, 5);
  42.     if Cup = ELoca then
  43.       writeln
  44.     else
  45.       Writeln(nilfil,Enn);
  46.   until (Cup = ELoca) or EOF(infil);
  47.   close(infil);
  48.   close(nilfil);
  49. end;
  50. begin
  51.   PrintScr('Bulk.Ans','@2---','@3---');
  52. end.
  53.  
  54. 'Bulk.ans' would be in this format :
  55. @1-------------------------------------------------------------------
  56. Esc[2J This is your first ansi screen;;;
  57. @2-------------------------------------------------------------------
  58. Esc[K This would be your second ansi screen and so on and on I
  59. had about 6 or 7 ANSI screens in One file
  60. @3-------------------------------------------------------------------
  61. I used ANSIDraw to make my screens and then used Turbo3 to add them
  62. all into one file with the Ctrl-K,R Command. (TheDraw and Qedit) would
  63. be much better To use now thought.
  64. I tested this Program on a few ANSI Screens I thur together into one
  65. and it worked ok here using Turbo Pascal 7.0
  66. I'm sure this could be done better as well but if it helps good!
  67.